package com.yipao.core.mqtt.service;

import com.alibaba.fastjson.JSONObject;
import com.yipao.core.mqtt.vo.MqttSendAdVo;
import com.yipao.core.mqtt.vo.MqttSendVo;
import com.yipao.core.util.HttpClientUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * mqtt发送
 *
 * @author tianhao
 * @date 2020/6/8 22:27
 **/
@Slf4j
@Component
public class MqttSendService {

    /**
     * 发送
     *
     * @param mqttSendVo
     */
    public void send(String mqttUrl,MqttSendVo mqttSendVo) {
        String s = HttpClientUtil.doPost(mqttUrl, JSONObject.toJSONString(mqttSendVo));
        if (s.isEmpty()) {
            log.error("mqtt发送异常");
        }
    }




}
